//
//  MSTypeBViewCell.m
//  MSJD
//
//  Created by xiangbo on 2018/9/22.
//  Copyright © 2018 xiangbo. All rights reserved.
//

#import "MSTypeBView.h"
#import "MSTypeBDetailView.h"
#import "MSTitleView.h"

@interface MSTypeBView()

@property (nonatomic, strong)MSTitleView *titleView;
@property (nonatomic, strong)MSTypeBDetailView *showView;

@end

@implementation MSTypeBView

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self setupSubViews];
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupSubViews];
    }
    return self;
}

- (void)setupSubViews{
    self.titleView = [[MSTitleView alloc] init];
    [self addSubview:self.titleView];
    
    self.showView = [[MSTypeBDetailView alloc] init];
    [self addSubview:self.showView];
    
    [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.and.right.equalTo(self);
        make.height.mas_equalTo(79.f);
    }];
    
    [self.showView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleView.mas_bottom);
        make.left.equalTo(self).offset(11);
        make.right.equalTo(self).offset(-11);
        make.bottom.equalTo(self);
    }];
}

#pragma mark dataSet
- (void)setupTemplateData:(MSFoodData *)templateData{
    [self.titleView refreshTitle:templateData];
}

@end
